<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cetak Penjualan Produk</title>
<style type="text/css">
html,body,table,tr,td{
	font-family:Geneva, Arial, Helvetica, sans-serif;
	font-size:12px;
}
.title{
	font-size:12px;
}
</style>
</head>
<body onload="window.print();">
<?php 
#
function terbilang($x, $style=4) {
	#
	if($x<0) {
		#
	$hasil = "minus ". trim(kekata($x));
		#
} else {
	#
	$hasil = trim(kekata($x));
	#
}
#
switch ($style) {
#
case 1:
#
	$hasil = strtoupper($hasil);
	#
	break;
	#
	case 2:
	#
	$hasil = strtolower($hasil);
	#
	break;
	#
	case 3:
	#
	$hasil = ucwords($hasil);
	#
	break;
	#
	default:
	#
	$hasil = ucfirst($hasil);
	#
	break;
	#
}
#
return $hasil;
#
	}
	#
?>

?>
<table width="960px" border="0px" cellspacing="0px" cellpadding="0px">
  <tr>
    <td width="30px">&nbsp;</td>
    <td width="900px">&nbsp;</td>
    <td width="30px">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td height="100px"><table width="900px" height="100px" border="0px" cellspacing="0px" cellpadding="0px">
      <tr>
        <td width="292px" rowspan="4" align="center">Jl. Karah Agung I / 35 Surabaya<br />Telp. 031 - 827 3073<br />Fax. 031 - 829 4458</td>
        <td width="210px">Surabaya,</td>
        <td width="398px">&nbsp;<?php echo $bill_date;?></td>
      </tr>
      <tr>
        <td>Kepada Yth. </td>
        <td rowspan="3" valign="top"><?php echo $customer_name;?><br /><?php echo $customer_address;?></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>NOTA No. <?php ?></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><table width="900px" border="0px" cellspacing="0px" cellpadding="0px">
      <tr>
        <td>Banyaknya</td>
        <td>NAMA BARANG</td>
        <td>HARGA</td>
        <td>JUMLAH</td>
      </tr>
   	<?php 
	$i=0;
	$total=0;
	foreach($data_print as $list => $row) { $i+=1;
	?>
      <tr>
        <td>&nbsp;<?php echo $row->orderdet_qty;?></td>
        <td>&nbsp;<?php echo $row->orderdet_detail;?></td>
        <td align="right">&nbsp;<?php echo $row->orderdet_price;?></td>
        <td align="right">&nbsp;<?php echo $row->jumlah;?></td>
      </tr>
   	<?php 
		$total += $row->jumlah;
	}
	?>
      <tr>
        <td colspan="3" align="right">TOTAL&nbsp;&nbsp;</td>
        <td align="right">&nbsp;<?php echo $total;?></td>
      </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="40px">&nbsp;</td>
    <td valign="top">Terbilang : <?php echo $terbilang;?></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><table width="900px" height="100px" border="0px" cellspacing="0px" cellpadding="0px">
      <tr>
        <td width="150px" align="center"><p>Diterima oleh,</p>
          <p>&nbsp;</p>
          <p>&nbsp;</p></td>
        <td width="600px">&nbsp;</td>
        <td width="150px" align="center"><p>Hormat Kami,</p>
          <p>&nbsp;</p>
          <p>CATUR MULYONO</p></td>
      </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
